= locomotive_form_for @page, url: update_all_editable_elements_path(current_site, @page), remote: true, html: { multipart: true }, defaults: { placeholder: false, hint: false } do |f|

  .container-fluid.main role='main'
    .row.header-row
      .col-md-12
        h1= truncate(@content_entry.try(:_label) || @page.title, length: 50)

    .row.info-row
      .col-sm-7.col-xs-7
        span.fullpath= nice_editable_elements_path

        | &nbsp;
        | &mdash;
        | &nbsp;

        = link_to edit_page_path(current_site, @page, _location: request.fullpath) do
          i.fas.fa-cog
          | &nbsp;
          = t('.settings_link')

      .col-sm-5.col-xs-5
        .text-right
          - if current_site.localized?
            = page_locale_picker_link(@page, @content_entry)
          - unless @editable_elements.blank?
            | &nbsp;
            = f.action

      - if @editable_elements.nil?
        .col-sm-12.col-xs-12
            br
            .alert.alert-warning.text-center role="alert"
              == t('.parsing_error')

      - elsif @editable_elements.empty?
        - if @content_entry.nil?
          .col-sm-12.col-xs-12
            br
            .alert.alert-warning.text-center role="alert"
              = t('.no_editable_elements')

      - else
        .col-sm-12.col-xs-12
          fieldset.inputs
            .form-group.input.select.optional.inline
              label.select.optional.control-label for='page_block'
                = t(:region, scope: 'simple_form.labels.locomotive.editable_element')
              span.form-wrapper
                = select_tag 'block', options_for_page_blocks(@blocks)

  .scrollable class="#{'no-editable-elements' if @editable_elements.blank?}"
    .container-fluid
      .row
        .col-md-12
          - if @content_entry
            fieldset.inputs
              .form-group.input.link.optional
                label.link.control-label.optional
                  span.label.label-primary= @content_entry.content_type.name
                  | &nbsp; / &nbsp;
                  = @content_entry._label
                span.form_wrapper
                  = link_to t(:edit, scope: 'locomotive.editable_elements.form.model.buttons'), edit_content_entry_path(current_site, @content_entry.content_type.slug, @content_entry, _location: request.fullpath), class: 'btn btn-primary btn-sm'

          = render 'form', f: f unless @editable_elements.blank?
